const { rejects } = require("assert");
const { readFile } = require("fs");

//1.引入fs模块
const fs = require('fs')
    //2.读取【为学】
function readWeiXue(filename) {
    return new Promise((resolve, reject) => {
        fs.readFile('./resources/' + filename, (err, data) => {
            if (err) reject(err);
            resolve(data);
        })
    })
}
async function main() {
    let weixue = await readWeiXue('为学.md');
    let chayangshi = await readWeiXue('插秧诗.md')
    let guanshuyougan = await readWeiXue('观书有感.md')
    console.log(weixue.toString());
    console.log(chayangshi.toString());
    console.log(guanshuyougan.toString());

}
main();